<?php
/**
 * Created by PhpStorm.
 * User: yangjiaming
 * Date: 2018/2/6
 * Time: 16:56
 */

namespace Eagle\Service;


class EagleRedis
{
    private $client;

    public static function getClient($host = [])
    {
        $redis = new \Redis();
        $redis->connect('127.0.0.1', 6379);
        return $redis;
    }
    public static function get($key)
    {
        return self::getClient()->get($key);
    }
    public static function set($key, $value)
    {
        return self::getClient()->set($key, $value);
    }
    public static function hGet($key, $hashKey)
    {
        return self::getClient()->hGet($key, $hashKey);
    }
    public static function hSet($key, $hashKey, $value)
    {
        return self::getClient()->hSet($key, $hashKey, $value);
    }
    public static function zAdd($key, $hashKey, $value)
    {
        return self::getClient()->zAdd($key, $hashKey, $value);
    }
    public static function zRange($key, $start, $end, $withscores = null)
    {
        return self::getClient()->zRange($key, $start, $end, $withscores = null);
    }
    public static function zRem($key, $member1)
    {
        return self::getClient()->zRem($key, $member1);
    }
}